﻿/*
 * @Autor: PK
 * @Date: 2022/01/27 09:04:SS
 */

using System;
using O2DESNet.Distributions;

namespace ShkSimulation.core.template.model {

	public interface ServiceRateHelper {

		TimeSpan GetAverageServiceTime();

	}

	public class StableServiceRateHelper : ServiceRateHelper {

		public StableServiceRateHelper(TimeSpan timeSpan, Random random = null) {
			this.ServiceTime = timeSpan;
			this.random = random ?? new Random();
		}

		public TimeSpan ServiceTime { get; private set; }

		private Random random;

		public TimeSpan GetAverageServiceTime() {
			return Exponential.Sample(random, ServiceTime);
		}

	}

}